package com.cssw.fyzb.busi.service.pay;

import com.cssw.fyzb.core.model.dodb.PayOrder;
import com.ydn.appserver.Response;

import java.math.BigDecimal;

/**
 * @author zhouxu
 * @Date 20201218
 */
public interface PayService {

    /**
     * 生成支付订单
     *
     * @param userId     用户ID
     * @param payAmount  支付金额
     * @param payBusi    支付业务
     * @param outTradeNo 订单号生成
     * @param payWay     支付方式
     * @return
     */
    PayOrder createPayOrder(Long userId, Integer payAmount, String payBusi, String outTradeNo, String payWay, BigDecimal fCoinNum);

    PayOrder findByUserPayAuthOrder(Long userId);

    PayOrder findByUserVipOrder(Long userId);

    void updatePayOrderInit(PayOrder order, String outTradeNo);

    Response aliPay(PayOrder order);

    /**
     * 支付宝ada平台支付
     *
     * @param order
     * @param goodsTitle
     * @param goodsDesc
     * @return
     */
    Response aliAdapay(PayOrder order, String goodsTitle, String goodsDesc);

    Response wxPay(PayOrder order);

    void updatePayStatus(PayOrder order, String status);

    void updateUserPay(Long userId, String tradeNo, String payType);

    /**
     * 微信ada平台支付
     *
     * @param order
     * @param goodsTitle
     * @param goodsDesc
     * @param expend
     * @return
     */
    Response wxAdapay(PayOrder order, String goodsTitle, String goodsDesc, String expend);

    boolean queryAdapay(String tradeNo);

    boolean wxOrderQuery(String tradeNo);

    boolean aliOrderQuery(String tradeNo);

    void afterPayBusi(String tradeNo);

    void saveAdapayNotifyLog(String params);

    PayOrder getByTradeNo(String tradeNo);
}
